class Solution
{
public:
    ListNode* addTwoNumbers(ListNode* l1, ListNode* l2)
    {
        if (!l1) return l2;
        if (!l2) return l1;

        int t = l1->val + l2->val;
        ListNode* ans = new ListNode(t % 10);

        ans->next = addTwoNumbers(l1->next, l2->next);
        if (t >= 10)
            ans->next = addTwoNumbers(ans->next, new ListNode(1));

        delete l1, l2;

        return  ans;
    }
};